<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>默认行为</title>
		<style>
			#demo{
				position:absolute;
				display: none;
			}
		</style>
	</head>
	<body>
		<ul id = "demo">
			 <li>音乐你知道吗？</li>
			 <li>美食你知道吗？</li>
			 <li>网游你知道吗？</li>
			 <li>电竞你知道吗？</li>
			 <li>你知道吗？</li>
			 <li>你真的知道吗？</li>
		</ul>
		<script> 
			//阻止默认行为
//			document.oncontextmenu = function(){
//				return false;
//			}
             var demo = document.getElementById("demo");
			 document.oncontextmenu = function(e){
				var oEv = e || event;
				demo.style.display = "black";
				demo.style.left = oEv.clientX + "px";
				demo.style.top = oEv.clientY + "px";
				return false;
			
			 document.onclick = function(){
			 	demo.style.display ="none";
			 }
	
			}
			
		</script>
	</body>
</html>
